<div class="col-md-12">
	<div class="col-md-12" align="center"><h3>利润表</h3></div>
	<div class="col-md-4">编制单位：</div>
	<div class="col-md-6">
        <div>
            <input type="text" class="form-control datepicker" readonly data-format="yyyy-MM-dd" name="qaddtime" value="<?php echo date('Y-m-d')?>" style="width:150px; float:left">
            <span style="float:left">&nbsp;至&nbsp;</span>
            <input type="text" class="form-control datepicker" readonly data-format="yyyy-MM-dd" name="zaddtime" value="<?php echo date('Y-m-d')?>" style="width:150px;float:left">
            &nbsp;<button type="button" class="entypo-search btn btn-primary" onclick="getProfit()">搜索</button>
        </div>
    </div>
	<div class="col-md-2">单位：元</div>
	<br style="clear:both"/>
	<table class="table table-bordered datatable" style="margin:8px 0">
		<thead>
			<tr>
				<th>项目</th>
				<th>行次</th>
				<th>本期金额</th>
				<th>上期金额</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>一、主营业务收入</td>
				<td>1</td>
				<td><b id="zyywsy">加载中...</b></td>
				<td></td>
			</tr>
			<tr>
				<td>减：主营业务成本</td>
				<td>2</td>
				<td><b id="zyywcb">加载中...</b></td>
				<td></td>
			</tr>
			<tr>
				<td>主营业务税金及附加</td>
				<td>3</td>
				<td>0</td>
				<td></td>
			</tr>
			<tr>
				<td>二、主营业务利润（亏损以“－”号填列）</td>
				<td>4</td>
				<td><b id="zyywly">加载中...</b></td>
				<td></td>
			</tr>
			<tr>
				<td>加：其他业务收入</td>
				<td>5</td>
				<td>0</td>
				<td></td>
			</tr>
			<tr>
				<td>投资收益（损失以“－”号填列）</td>
				<td>6</td>
				<td>0</td>
				<td></td>
			</tr>
			<tr>
				<td>减：其他业务支出</td>
				<td>7</td>
				<td></td>
				<td></td>
			</tr>
			<tr>
				<td>销售费用</td>
				<td>8</td>
				<td></td>
				<td></td>
			</tr>
			<tr>
				<td>财务费用</td>
				<td>9</td>
				<td></td>
				<td></td>
			</tr>
			<tr>
				<td>管理费用</td>
				<td>10</td>
				<td></td>
				<td></td>
			</tr>
			<tr>
				<td>三、营业利润（亏损以“－”号填列）</td>
				<td>11</td>
				<td></td>
				<td></td>
			</tr>
			<tr>
				<td>加：营业外收支净额（亏损以“－”号填列）</td>
				<td>12</td>
				<td></td>
				<td></td>
			</tr>
			<tr>
				<td>四、利润总额（亏损总额以“－”号填列）</td>
				<td>13</td>
				<td></td>
				<td></td>
			</tr>
			<tr>
				<td>减：所得税费用</td>
				<td>14</td>
				<td></td>
				<td></td>
			</tr>
			<tr>
				<td>五、净利润（净亏损以“－”号填列）</td>
				<td>15</td>
				<td></td>
				<td></td>
			</tr>
		</tbody>
	</table>
</div>
<script>
	Core.rebuildUI();
	function getProfit(){
			$('#zyywsy').html('加载中...');
			$('#zyywcb').html('加载中...');
			$('#zyywly').html('加载中...');
		$.post(WEB+'stats/getprofit',{qaddtime:$('[name=qaddtime]').val(),zaddtime:$('[name=zaddtime]').val()},function(c){
			$('#zyywsy').html(c.total_price?c.total_price:0);
			$('#zyywcb').html(c.cost_price?c.cost_price:0);
			$('#zyywly').html((c.total_price-c.cost_price)?c.total_price-c.cost_price:0);
		},'JSON');			
	}
	$(function(){
		   getProfit();
    });
</script>